<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ProProducts extends Model
{
    protected $table = 'pro_products';


    public function category()
    {
        return $this->belongsTo(ProCategory::class, 'categoryid', 'id');
    }


    public function setCreatetimeAttribute($createtime)
    {
        $this->attributes['createtime'] = strtotime($createtime);

    }

    public function getCreatetimeAttribute($createtime)
    {
        return date('Y-m-d H:i:s', $createtime);

    }


}
